<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // var sum={name:"爸爸",age:18,sex:"小仙女"};

// 打印的两种方式
    //     console.log(sum);
    //    console.log(sum['name']);
    var obj = {
        
            arr:["张三","李四","王五"],
            name:"王小二",
            age:20,
            height:"178cm",
            fn:function(){
                console.log("姓名是"+obj.name+"年龄是"+obj.age+"身高是"+obj.height)
            }
          
        } 
        
        for(var abc in obj){
            if(typeof obj[abc]=="function"){
                obj[abc]();
            }
            if(Array.isArray(obj[abc]) ){
for(var i=0;i<obj[abc].length;i++){
    console.log(obj[abc][i]);
}

            }
                // console.log(obj.arr[abc]);
            }
      
    </script>
</body>
</html>